<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<f:view>


    <f:loadBundle basename="ApplicationResources" var="msg"/>
    
    <div id="page-ctn">

		<div id="QQBody" align ="center">
			    <p><h:outputText value="#{msg.userRegiste}" /></p>
		    <h:form id="userRegisteForm">
		        <h:panelGrid columns="4" styleClass="detail" columnClasses="label">
		
		            <h:outputText value="#{msg.username}" /> <h:outputText value="#{msg.colon}" />
		            <h:inputText value="#{userRegisteForm.username}" id="username" disabled="#{userRegisteForm.loginFlag}"/>
		            <h:message for="username" styleClass="errorMessage"/>
		
		           	<h:outputText value="#{msg.password}" /> <h:outputText value="#{msg.colon}" />
		            <h:inputSecret type="password" value="#{userRegisteForm.password}" id="password"/>
		            <h:message for="password" styleClass="errorMessage"/>
		
		           	<h:outputText value="#{msg.passwordCk}" /> <h:outputText value="#{msg.colon}" />
		            <h:inputSecret type="password" value="#{userRegisteForm.passwordCk}" id="passwordCk"/>
		            <h:message for="passwordCk" styleClass="errorMessage"/>
		            
		            <h:outputText value="#{msg.usernameCn}" /> <h:outputText value="#{msg.colon}" />
		            <h:inputText value="#{userRegisteForm.usernameCn}" id="usernameCn"/>
		            <h:message for="usernameCn" styleClass="errorMessage"/>
		
		            <h:outputText value="#{msg.mail}" /> <h:outputText value="#{msg.colon}" />
		            <h:inputText value="#{userRegisteForm.mail}" id="mail"/>
		            <h:message for="mail" styleClass="errorMessage"/>
		
		            <h:panelGroup>
		            <c:choose>
						<c:when test="#{userRegisteForm.loginFlag}">
						   <h:commandButton value="#{msg.updateBtn}" action="#{userRegisteForm.updateUserAction}" id="update" styleClass="button"/>
						</c:when>
						<c:otherwise >
			               <h:commandButton value="#{msg.registeBtn}" action="#{userRegisteForm.registeUserAction}" id="save" styleClass="button"/>
			            </c:otherwise> 
					</c:choose>
		                
		                <h:commandButton value="#{msg.cancelBtn}" action="cancel" immediate="true" id="cancel" styleClass="button"/>
		            </h:panelGroup>
		        </h:panelGrid>
		    </h:form>
		</div>
		</div>
</f:view>
</html>